﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Paint
{
    [Serializable]
    class Ellipse : Drawable
    {
        public Ellipse(Point startPoint, Point endPoint) : base(startPoint, endPoint) { }

        public override void draw(Graphics g)
        {
            int minX = Math.Min(startPoint.X, endPoint.X);
            int maxX = Math.Max(startPoint.X, endPoint.X);
            int minY = Math.Min(startPoint.Y, endPoint.Y);
            int maxY = Math.Max(startPoint.Y, endPoint.Y);
            Rectangle rect = new Rectangle(minX, minY, maxX - minX, maxY - minY);
            g.DrawEllipse(context.createPen(), rect);
            g.FillEllipse(context.createBrush(), rect);
            
        }
    }
}
